1. Field of the Invention
The present invention relates to disk drives for computer systems. More particularly, the present invention relates to using a defect list to perform uninterrupted writing of non-relocated data blocks and caching of relocated data blocks for deferred writing.
2. Description of the Prior Art
Disk drives typically employ some form of defect management for mapping defective sectors in data tracks recorded on a disk to spare disk locations. As illustrated in FIG. 1A, a data track 4 may comprise a predetermined number of disk locations, where a predetermined number of the disk locations are spare disk locations. The example data track 4 of FIG. 1A comprises twelve disk locations, the last three of which are spare disk locations. The disk will also typically include a plurality of spare tracks comprising only spare disk locations as illustrated by the spare track 6 shown in FIG. 1A.
The disk locations in a track are identified by a physical block address (PBA), for example, a consecutive sequence of numbers. A host computer connected to the disk drive will provide a logical block address (LBA) to the disk drive in connection with a request to write or read data. The disk drive translates the LBA into the corresponding PBA which facilitates defect management in a manner that is transparent to the host computer.
One known method for defect management is to xe2x80x9cpush downxe2x80x9d LBAs past defective disk locations that are discovered during manufacturing of the disk drive. When a defective disk location is discovered during normal operation (i.e., a xe2x80x9cgrown defectxe2x80x9d), the LBA associated with the defective disk location is mapped to a spare disk location in one of the spare tracks. This defect management technique is illustrated in FIG. 1A which shows a data track 4 comprising a defective disk location discovered during manufacturing, and three defective disk locations discovered during normal operation. The defective disk location discovered during manufacturing has a PBA of 2 and therefore LBA 2 is assigned to PBA 3. The remaining LBA""s are pushed down one disk location such that the last LBA (LBA 8) is assigned to the first spare disk location in the track having a PBA of 9. During normal operation, disk locations with PBAs of 4, 7 and 8 became defective and therefore the corresponding LBAs 3, 6 and 7 were mapped to spare disk locations of a spare track 6. The data blocks stored in the spare disk locations of the spare track 6 are referred to as xe2x80x9cRelocated Data Blocksxe2x80x9d (RDB), and the data blocks stored in the sectors of the data track 4 are referred to as xe2x80x9cNon-Relocated Data Blocksxe2x80x9d (NRDB).
The spare tracks are typically banded together on a reserved area of the disk, for example, at the inner diameter of the disk. This is illustrated in FIG. 1B which shows a disk drive 1 comprising a disk 2 including the data track 4 and the spare track 6 of FIG. 1A, wherein the spare track 6 is located at an inner diameter of the disk 2.
The disk drive 1 of FIG. 1B comprises a head 8 connected to an actuator arm 9 which is actuated radially over the disk 2, and disk control system 20 for executing the steps of a program to perform read and write operations. During a write operation, the disk drive 1 receives from a host a write command to write data blocks to the disk 2, typically in a consecutive sequence of LBAs. For example, the disk drive 1 may receive a request from the host to write LBAs 0-8 in FIG. 1A. The corresponding data blocks received from the host are stored sequentially in a cache 16 using a cache data structure 17. The disk control system 20 also employs a defect list 18 which stores information to facilitate translating the LBAs into the corresponding PBAs and then controls the head 8 to seek to the appropriate tracks. The data blocks are retrieved from the cache 16 using the cache data structure 17, and then written to the disk 2 via a write channel circuit 12 once the head is positioned over the target sector.
For example, when writing the LBA sequence 0-8 of FIG. 1A, the disk control system 20 positions the head 8 over data track 4, sequentially retrieves NRDB0 and NRDB1, from the cache 16 using the cache data structure 17, and then sequentially writes NRDB0 and NRDB1 to PBA 0 and PBA 1 via the write channel 12. Because LBA 2 has been pushed down to PBA 3 (as mapped by the defect list 18), the disk control systems 20 skips over PBA 2 and writes NRDB2 to PBA 3. Because LBA 3 is mapped to PBA 0 of spare track 6, the disk control system 20 performs a seek operation to position the head 8 over spare track 6 in order to write RDB3. The disk control system 20 then performs another seek operation to reposition the head 8 over data track 4 in order to write NRDB4 and NRDB5 to PBA 5 and PBA 6. Because LBA 6 and LBA 7 have been mapped to PBA 1 and PBA 2 of spare track 6, the disk control system 20 performs another seek operation to spare track 6 in order to write RDB6 and RDB7. Finally, the disk control system 20 performs yet another seek operation to reposition the head 8 over data track 4 in order to write NRDB8 (to the first spare disk location of data track 4).
Seeking to a spare track during write operations in order to write relocated data blocks can increase significantly the access time of the disk drive 1. If the disk drive 1 cannot keep up with the data transfer rate of the host, the cache 16 will eventually fill up with data. The disk control system 20 will then signal the host to stop transferring data until more room is available in the cache 16. Thus, the write efficiency of the disk drive 1 is limited by the prior art technique of seeking to spare tracks during write operations to write relocated data blocks.
There is, therefore, a need to improve write efficiency in a disk drive, particularly with respect to writing relocated data blocks to spare tracks.
The present invention may be regarded as a disk drive for receiving a write command from a host computer, the write command comprising a plurality of logical block addresses (LBAs) and a plurality of data blocks. The plurality of data blocks comprises at least one non-relocated data block (NRDB) and at least one relocated data block (RDB), and at least one of the LBAs corresponds to the NRDB and at least one of the LBAs corresponds to the RDB. The disk drive comprises a disk comprising a plurality of first disk locations each having a defect, a plurality of second disk locations for storing NRDBs, and a plurality of spare disk locations for storing RDBs. A defect list is used to map LBAs from the plurality of first disk locations to the plurality of spare disk locations. A cache is logically partitioned into a first set of memory locations managed using a first cache data structure, and a second set of memory locations managed using a second cache data structure. A disk control system uses the first cache data structure to store the NRDB in a first memory location selected from the first set of memory locations. The disk control system evaluates the defect list using the LBAs to identify the RDB and using the second cache data structure stores the RDB in a second memory location selected from the second set of memory locations. During a first time interval established for writing NRDBs, the disk control system uses the first cache data structure to write the NRDB to one of the second disk locations. During a second time interval established for writing RDBs, the disk control system uses the second cache data structure to write the RDB to one of the spare disk locations.
The present invention may also be regarded as a method of performing a write operation in a disk drive in response to a write command received from a host computer, the write command comprising a plurality of logical block addresses and a plurality of data blocks. The plurality of data blocks comprises at least one non-relocated data block (NRDB) and at least one relocated data block (RDB), and at least one of the LBAs corresponds to the NRDB and at least one of the LBAs corresponds to the RDB. The disk drive comprises a disk comprising a plurality of first disk locations each having a defect, a plurality of second disk locations for storing NRDBs, and a plurality of spare disk locations for storing RDBs. A defect list is used to map LBAs from the plurality of first disk locations to the plurality of spare disk locations. A cache is logically partitioned into a first set of memory locations managed using a first cache data structure, and a second set of memory locations managed using a second cache data structure. The first cache data structure is used to store the NRDB in a first memory location selected from the first set of memory locations. The defect list is evaluated using the LBAs to identify the RDB and using the second cache data structure the RDB is stored in a second memory location selected from the second set of memory locations. During a first time interval established for writing NRDBs, using the first cache data structure the NRDB is written to one of the second disk locations. During a second time interval established for writing RDBs, using the second cache data structure the RDB is written to one of the spare disk locations.